﻿<%@ Page Title="" Language="C#" MasterPageFile="~/PAGES/Master.Master" AutoEventWireup="true" CodeBehind="gerenciar_usuario.aspx.cs" Inherits="WebSite.PAGES.gerenciar_usuario" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="container">
        <div class="row">
            <div class="col-lg-10 col-md-10 col-lg-offset-1 col-md-offset-1">
                <h2 class="col-lg-offset-4">Cadastro de Usuários</h2>
                <br />
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="Id" DataSourceID="ObjectDataSource1" CssClass="table table-bordered  table-hover col-lg-12 col-md-12 hidden-xs hidden-sm" OnRowDataBound="GridView1_RowDataBound">
                    <Columns>
                        <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" />
                        <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
                        <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                        <asp:BoundField DataField="Login" HeaderText="Login" SortExpression="Login" />
                        <asp:CheckBoxField DataField="Ativo" HeaderText="Ativo" SortExpression="Ativo" />
                        <asp:HyperLinkField DataNavigateUrlFields="Id" DataNavigateUrlFormatString="editar_usuario.aspx?id={0}" Text="Editar" />
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete" OnClientClick="if(confirm('Deseja excluir esse usuário?')){ return true; }else{ return false; }" Text="Excluir"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                <br />
                <br />
                <asp:Button ID="btnNovoUsuario" type="button" value="button" class="btn btn-lg btn-primary btn-block" runat="server" Text="Novo Usuário" OnClick="btnNovoUsuario_Click" CssClass="col-lg-2 col-md-offset-9 col-lg-offset-9 btn btn-primary" />
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="ExcluiUsuario" SelectMethod="ListaUsuarios" TypeName="WebSite.Business.Usuarios">
                    <DeleteParameters>
                        <asp:Parameter Name="Id" Type="Int32" />
                    </DeleteParameters>
                </asp:ObjectDataSource>
            </div>
        </div>
    </div>
</asp:Content>
